package com.demo.animal;

import com.demo.MyAnimal;
import com.spring.annotation.AutoWired;
import com.spring.annotation.Component;
import com.spring.annotation.PostConstruct;

/**
 * @author chengjy
 * @date 2025/4/7
 */
@Component
public class Dog implements MyAnimal {

    public Dog(Cat cat) {
        this.cat = cat;
    }

    private Cat cat;

    @PostConstruct
    public void say() {
        System.out.println("我有一只"+ cat.describe());
    }

    @Override
    public String describe() {
        return "狗狗";
    }
}
